home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / pp / insert.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-01  |  1.0 KB  |  35 lines

  1. /*
  2. \funcref{insert}{void insert (\params)}
  3.     {
  4.         {char} {*idname} {identifier to insert in symbols table}
  5.     }
  6.     {}
  7.     {xrealloc()}
  8.     {directive()}
  9.     {insert.c}
  10.     {
  11.         {\em insert()} is called from {\em directive()} when an {\em \#define}
  12.         directive is read.
  13.         Function {\em insert()} is passed the name of a redefined identifier by
  14.         the {\em idname} argument. The redefinition part is expected in the
  15.         lexical buffer {\em lexbuf}.
  16.  
  17.         The definition is inserted by increasing the array of {\em DEFINED\_}
  18.         structures, pointed to by {\em defined}, by one element. Then, the {\em
  19.         ident} and {\em redef} fields of the newly created struct are assigned.
  20.  
  21.         After this, the counter {\em ndefined} is increased.
  22.     }
  23. */
  24.  
  25. #include "icm-pp.h"
  26.  
  27. void insert (char *idname)
  28. {
  29.     defined = xrealloc (defined, (ndefined + 1) * sizeof (DEFINED_));
  30.     defined [ndefined].ident = xstrdup (idname);
  31.     defined [ndefined].redef = xstrdup (lexbuf);
  32.  
  33.     ndefined++;
  34. }
  35.